package com.demo.entity;

import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.demo.entity.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.jetbrains.annotations.NotNull;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author Ymj
 * @since 2020-11-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@ApiModel("进出信息")
public class Record extends BaseEntity {

    @NotNull
    @ApiModelProperty("人员id")
    private Long pId;//人员id
    @NotNull
    @ApiModelProperty("区域id")
    private Long aId;//区域id

    @NotNull
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @TableField(value = "r_recordDate")
    @ApiModelProperty("通行时间点")
    private Date recordDate;//通行时间点

    @TableField(value = "r_status")
    @ApiModelProperty("状态")
    private String status;//状态  A正常 B非正常时间进出  C越权进出

    @TableField(value = "r_direction")
    @ApiModelProperty("进出")
    private String direction;//进出  A进入  B离开
    @TableField(exist = false)
    @ApiModelProperty("区域")
    private Area area;
    @TableField(exist = false)
    @ApiModelProperty("个人信息")
    private Person person;
}
